import { ChannelListType } from '@/store/reducer/channel';
import request from '@/utils/request';
export function getAllChannel() {
  return request({
    url: '/v1_0/channels',
  });
}
export function getUserChannel() {
  return request({
    url: '/v1_0/user/channels',
  });
}

export type addChannelDataType = {
  channels: ChannelListType[];
};
export function addChannelAPI(data: addChannelDataType) {
  return request({
    url: '/v1_0/user/channels',
    method: 'patch',
    data,
  });
}
export function delChannelAPI(target: number) {
  return request({
    url: `/v1_0/user/channels/${target}`,
    method: 'delete',
  });
}
